#ifndef VIDEOCONTROLLER_HXX
#define VIDEOCONTROLLER_HXX

#include <QObject>
#include "TrackingThread.hxx"
#include "VideoThread.hxx"
class VideoView;
class Sequence;
class VideoThread;
class TrackingThread;
class Project;

class VideoController : public QObject
{
    Q_OBJECT
public:
    explicit VideoController(QObject *parent = nullptr);
	~VideoController();

public:
	void playVideo();
	void pauseVideo();
	void resumeVideo();
	void startTrack(const char* trackerType, const char* modelType);
	void startOpenCVTracker(const char* trackerType);
	void startSORTTracker(const char* modelType);
	void startYOLOTracker(const char* modelType);
	void stopTrack();
	void makeSingleFrameObjects();
	void makeNegativeSampleFrame();
	void slow();
	void fast();
	void nextFrame();
	void actionGoFrame(int findex);

	inline bool isPaused() { return _videoThread->isPaused(); }
signals:

	public slots :
		void seekVideoPosition(double pos);

	inline void setView(VideoView* view) { _view = view; }
    inline void setProject(Project* project) { _project = project; }
	inline bool isTracking() { return _trackingThread && _trackingThread->isTracking(); }
	inline TrackingThread* getTrackingThread() { return _trackingThread; }
private:
	VideoView* _view;
    Project* _project;

	VideoThread* _videoThread;
	TrackingThread* _trackingThread;
};

#endif // VIDEOCONTROLLER_HXX
